import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import * as cors from 'cors';

function MiddleWareAll(req:any, res:any, next:any) {
  console.log(req.path,'全局');
  next();
}

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  // app.setGlobalPrefix('api');//设置全局前缀
  app.use(cors());
  app.use(MiddleWareAll);
  await app.listen(9090);
}
bootstrap();
